<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>修改员工信息</title>
</head>
<body>

<form th:action="@{/emp}" method="post">
    <!--  添加隐藏域 提交表单时 真正使用的是 put 请求  -->
    <input type="hidden" name="_method" value="put">
    <!-- 需要将要修改的员工id一起传入到控制器 -->
    <input type="hidden" name="empId" th:value="${emp.empId}">

    <table align="center" border="1" cellspacing="0" cellpadding="1">
        <tr>
            <th colspan="4">修改员工信息</th>
        </tr>
        <tr>
            <th>员工姓名</th>
            <th colspan="2">性别</th>
            <th>薪水</th>
            <th>操作</th>
        </tr>
        <tr>
            <td><input type="text" name="name" th:value="${emp.name}"></td>
            <td>
                <input type="radio" name="sex" value="男" th:field="${emp.sex}">男
            </td>
            <td>
                <input type="radio" name="sex" value="女" th:field="${emp.sex}">女
            </td>
            <td><input type="text" name="sal" th:value="${emp.sal}"></td>
            <th><input type="submit" value="修改"></th>
        </tr>
    </table>

</form>


</body>
</html>